<?php
//缓存处理方法
function cache($name, $value = false){
	return F($name,$value,'data/cache');
}

//获得栏目的url
function getCategoryUrl($cid){
	return U('Index/Index/category',array('cid'=>$cid));
}

function searchAttrUrl($avid,$index,$title){
	$index--;
	$s = explode('-',Q('get.s'));
	//设置当前选中属性的样式
	if($s[$index]==$avid){
		$class="class='current'";
	}else{
		$class='';
	}
	$s[$index]=$avid;
	$s=implode('-',$s);
	$url = U('Index/Index/category',array('cid'=>Q('cid'),'s'=>$s));
	// p($s);exit;
	return "<a href='$url' $class>$title</a>";
}
